﻿using System;
using System.Collections.Generic;
using Wala.Connection.Objects.Profiles;
using Wala.Connection.HttpsConnections;
using System.Threading.Tasks;
using Wala.Infrastructure;

namespace Wala.Connection.Managements
{
    public class ProfileManager
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async static Task<ShortProfile> GetProfile(uint id)
        {
            string url = URLConstant.TIMLINE_HOST + string.Format(URLConstant.VIEW_PROFILE,id.ToString());
            string result = await ClientHttpsRequest.HttpsRequest(url);
            ShortProfile shortProfile = ShortProfile.FromJson(result);
            return shortProfile;
        }

        public async static Task<List<ShortProfile>> GetProfileList(string url)
        {
            string json = await ClientHttpsRequest.HttpsRequest(url);
            ShortProfiles shortProfiles = ShortProfiles.FromJson(json);

            return shortProfiles.Short_profiles;
        }
    }
}
